<?php
// R0910CMS 
// created by TLightSky
// time : 20100220

if(!defined("IN_R0910CMS")) {
    exit("Access Denied!");
}

interface R_Db_DbInterface {
    /**
     * @param Sql sentence
     * @return the result of the sql
     * @throws R_Db_Exception
     */
    public function query($sql);
    /**
     * @param Sql sentence
     * @return the result of the sql
     * @throws R_Db_Exception
     */
    public function exec($sql);
    /**
     * @param an array include all the options
     * @example $db->insert(array('table' => $tk->tname('admin'), 'values'=> array('name'=>'testname', 'pwd'=>'pwd', ) ));
     * @return the result of the sql
     * @throws R_Db_Exception
     */
    public function insert($arr);
    /**
     * @param an array include all the options
     * @example $db->select(array('table' => $tk->tname('admin'), 'where' => 'A = B')); 
     * @return the result of the sql
     * @throws R_Db_Exception
     *      
     */
    public function select($arr);
    /**
     * @param an array include all the options
     * @example $db->update(array('table' => $tk->tname('admin'), 'where' => 'A = B'), 'set' => array('username'=>'','comm'=>'nothing')); 
     * @return the result of the sql
     * @throws R_Db_Exception
     *      
     */
    public function update($arr);
    /**
     * @param an array include all the options
     * @example $db->delete(array('table' => $tk->tname('admin'), 'where' => 'A = B')); 
     * @return the result of the sql
     * @throws R_Db_Exception
     *      
     */
    public function delete($arr);
}

